<?php

class Default_Model_Config extends Zend_Db_Table_Abstract
{
	protected $_name = "ifunsoft_config";
	protected $_primary = "id";
	protected $db;
	var $id, $label, $parameter;
	public function __construct(){
		$this->db = Zend_Registry::get('db');
	}
	public function getConfig(){
		$query = $this->db->select();
		$query->from($this->_name);
		return $this->db->fetchAll($query);
	}
	public function updateConfig($data){
		try {
			for($i=0; $i<11; $i++){
				$data2 = array("parameter" => $data[$i]);
				$where = array("id =?" => $i+1);
				$this->db->update($this->_name, $data2, $where);
			}
			return true;
		} catch (Exception $e) {
			return false;
		}
	
	}

}

